﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AJAX_learning.Chapter9
{
	public partial class Chapter9d1 : System.Web.UI.Page
	{
		protected void ButtonGetEmployeesOnClick(object sender, EventArgs e)
		{
			//var ind = ListBoxCities.GetSelectedIndices();
			//var cities = new List<string>(ind.Count());
			//cities.AddRange(ind.Select(i => ListBoxCities.Items[i].Value));
			//this.Session.Add("SelectedCities", cities);
			//Response.Redirect("~/Chapter9/Chapter9d2.aspx");
			if (ListBoxCities.SelectedItem == null) return;
			Response.Redirect("~/Chapter9/Chapter9d2.aspx?city="+HttpUtility.UrlEncode(ListBoxCities.SelectedItem.Value));
				
		}
	}
}